package com.dcd.service;

import com.dcd.pojo.Video;
import com.dcd.service.impl.VideoServicimpl;
import org.apache.solr.client.solrj.SolrServerException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.util.List;
import java.util.Map;

@Component
@FeignClient(name = "donchedi-provider9091", fallback = VideoServicimpl.class, contextId = "video")
public interface VideoService {

    @RequestMapping("/VideoController/select_all_video_program")
    Map<String, Object> select_all_video_program(@RequestParam Integer pageVideoindex, @RequestParam Integer video_type_id);

    @RequestMapping("/VideoController/91select_all_video_ranking")
    List<Video> select_All_video_ranking();

    /**
     * 根据车系id查询该车系所有视频
     *
     * @param car_series_id 车系id
     * @return
     */
    @RequestMapping("/VideoController/select_series_id_video")
    List<Video> select_series_id_video(@RequestParam Integer car_series_id);

    /**
     * 查询最新的视频信息
     *
     * @return
     */
    @RequestMapping("/VideoController/select_new_video_mess")
    List<Video> select_new_video_mess();

    /**
     * 查询指定节目下指定车系视频
     *
     * @param program_id
     * @return
     */
    @RequestMapping("/VideoController/select_appoint_program_all_video")
    Map<String, Object> select_appoint_program_all_video(@RequestParam int program_id, @RequestParam int car_series_id, @RequestParam int page_index);

    /**
     * 根据视频id 查询视频
     * 返回 视频名称，路径 简介，以及用户资料
     *
     * @param video_id 视频id
     * @return
     */
    @RequestMapping("/VideoController/select_videoByID_video")
    Video select_videoByID_video(@RequestParam Integer video_id);

    /**
     * 根据视频id 查询该节目所有视频
     * 返回 视频基本信息 / 节目名称
     *
     * @param video_id
     * @return
     */
    @RequestMapping("/VideoController/select_video_id_all")
    List<Video> select_video_id_all(@RequestParam Integer video_id);


    /**
     * 搜索查询视频
     *
     * @param solr_content 搜索文本内容
     * @param page_index   当前页数
     * @return
     */
    @RequestMapping("/VideoController/select_video_by_solr")
    Map<String, Object> select_video_by_solr(@RequestParam String solr_content, @RequestParam int page_index) throws IOException, SolrServerException;
}
